import hyRequest from '@/service/index'

// 获取用户列表
export const getUser = (form?: any) => {
  return hyRequest.post({
    url: '/village/sysUser/page',
    data: form
  })
}

// 更改用户信息
export const editUser = (form?: any) => {
  return hyRequest.post({
    url: '/village/role/update',
    data: form
  })
}

// 更改用户密码
export const editUserPassword = (form?: any) => {
  return hyRequest.post({
    url: '/village/sysUser/updatePassword',
    data: form
  })
}

// 新增用户
export const addUser = (form?: any) => {
  return hyRequest.post({
    url: '/village/sysUser/insert',
    data: form
  })
}

// 删除用户
export const delUser = (form?: any) => {
  return hyRequest.post({
    url: '/village/sysUser/delete',
    data: form
  })
}

// 批量删除用户
export const delUsers = (form?: any) => {
  return hyRequest.post({
    url: '/village/sysUser/deleteBatch',
    data: form
  })
}

// 用户详细信息
export const detailUser = (userId: number) => {
  return hyRequest.post({
    url: '/village/sysUser/select',
    params: userId
  })
}

// 查询全部党员类别
export const getPartyCategory = () => {
  return hyRequest.post({
    url: '/village/partyMemberType/findAll'
  })
}

// 行政区-查询全部
export const getRegionAll = () => {
  return hyRequest.post({
    url: '/village/region/findAll'
  })
}

// 政治面貌-查询全部
export const getPoliticalAll = () => {
  return hyRequest.post({
    url: '/village/politicalOutlook/findAll'
  })
}

// 用户管理-按党组织分组查询
export const getPartyOrgUserAll = () => {
  return hyRequest.post({
    url: '/village/partyOrgUser/findAll'
  })
}

// 行政组织管理-查询全部-简化
export const getGovOrgV2All = () => {
  return hyRequest.post({
    url: '/village/govOrgV2/findAll'
  })
}

// 用户模板 - 下载模板
export const downloadTemplate = () => {
  return hyRequest.get({
    url: '/village/sysUser/downloadTemplate'
  })
}

// 用户管理 - 导出数据
export const leadData = (from: any) => {
  return hyRequest.get({
    url: '/village/sysUser/export',
    data: from
  })
}

// 用户管理-添加导入数据
export const loadData = (form: any) => {
  return hyRequest.post({
    url: '/village/sysUser/importData',
    data: form
  })
}

// 用户管理-导入模板
export const loadTemplate = (file: any) => {
  return hyRequest.post({
    url: '/village/sysUser/importTemplate',
    data: file
  })
}
